var $table;
$(document).ready(function(){
		$table=$('#resultTable').bootstrapTable({
			url:base+"/"+powerCode+"/getData",		//请求url
			/*queryParams:function(params){	//queryParams格式化请求参数所需要的数据信息
				return params;
			},	*/
			idField:"id",					//设置主键字段
			toolbar:"#custom-toolbar",				//显示自定义工具栏
			clickToSelect: true,			//点击行即可选中单选/复选框
			columns: [{align:"center",checkbox:true},
			          {field:'id',title:'id',visible:false},
			          {field:"powerName",title:"权限名称",align:"center"},
			          {field:"fatherName",title:"上级名称 ",align:"center"},
			          {field:"iconCls",title:"权限图标 ",align:"center",formatter:function(value,row){
			        	  return "<i class='"+row.iconCls+"'></i>";
			          }},
			          {field:"powerCode",title:"权限代码",align:"center"},
			          {field:"url",title:"权限URL",align:"center"},
			          {field:"type",title:"权限类型",align:"center",sortable:true,formatter:function(value,row){
				       	  if("M"==value){
				       		  return "<font color='green'>菜单<font>";
				       	  }else{
				       		  return "<font color='red'>操作<font>";
				       	  }
			       	   }},
			       	  {field:"used",title:"是否启用 ",align:"center",sortable:true,formatter:function(value,row){
			       		  if(1==value){
			       			  return "<font color='green'>是<font>";
			       		  }else{
			       			  return "<font color='red'>否<font>";
			       		  }
				       }},
				       {field:"position",title:"显示位置",align:"center",formatter:function(value,row){
				    	   var positions=row.position;
				    	   var result="";
				    	   if("M"==row.type){
				    		   return "-";
				    	   }
				    	   if(positions!=null&&positions!=""){
				    		   positions=positions.replace("[","").replace("]","").replace(" ","");
				    		   var positionArr=positions.split(",");
				    		   for(var i=0,len=positionArr.length;i<len;i++){
				    			   result+=positionArr[i]=="top"?"顶部/":"行中/";
				    		   }
				    		   result=result.substring(0,result.length-1);
				    	   }
				    	   return result;
				      }},
				      {field:"seq",title:"排序序号",align:"center",sortable:true}, 
			          {field:'createTime',title:"<i class='fa fa-clock-o'></i>&emsp;创建时间",align:'center',sortable:true},
			          {field:'operate',title:'操作',align:'center'}]
		});
});